import { Emoji } from 'libframe-docs/utils/Emoji'
import { PrerenderPreview } from './PrerenderPreview'
import ServerMiddleware from './ServerMiddleware.mdx'

### It's just a middleware

From an architectural point of view, `vite-plugin-ssr` is just a server middleware.

<ServerMiddleware />

### Pre-rendering (aka SSG)

You can also pre-render your app to remove the need for a production Node.js server and deploy to any static host
(Cloudflare Pages, GitHub Pages, Netlify, ...).

<PrerenderPreview />

<h3>Cloudflare Workers + <code>vite-plugin-ssr</code> = <Emoji name="red-heart" /></h3>

Thanks to `vite-plugin-ssr`'s lean architecture, your app is much less limited by Cloudflare Workers's 1MB bundle size limit.

Also, `vite-plugin-ssr` has been designed with first-class Cloudflare Workers support in mind, for example:
 - For development you can use Vite with an Express.js dev server for lightning fast HMR & dev start, and for production you can bundle your worker code with Cloudflare Workers's webpack bundler.
 - `vite-plugin-ssr` is the first SSR tool to work with Cloudflare Workers's support for HTML Streaming
